//在set中使用类要重载‘<’并实现拷贝构造函数
// by MoreWindows( http://blog.csdn.net/MoreWindows )
#include <set>
#include <ctime>
#include <cstdio>
using namespace std;
class Node
{
public:
	Node(int nAge = 0)
	{
		m_nAge = nAge;
	}
	Node(const Node &na)  //拷贝构造函数
	{
		m_nAge = na.GetAge();
	}
	int GetAge() const
	{
		return m_nAge;
	}
private:
	int m_nAge;
};
//不能写成类的成员函数
inline bool operator < (const Node &na, const Node &nb) 
{
	return na.GetAge() < nb.GetAge();
}
int main()
{
	int i;
	const int MAXN = 15;

	set<Node> nset;
	for (i = 0; i < MAXN; ++i)
		nset.insert(Node(i));
	return 0;
}
